package com.wsc.wisdomchinaqinghe.view;

import android.content.Context;
import android.widget.Toast;

/**
 * 
 * @Description 爱定义toast
 * @author jaily.zhang
 * @date 2015-8-17 下午2:19:34
 * @version V1.3.1
 */
public class MyToast {
	Context mContext;
	Toast mToast;

	public MyToast(Context context) {
		mContext = context;
		mToast = Toast.makeText(context, "", Toast.LENGTH_SHORT);
	}

	public void showShort(int resId) {
		showShort(mContext.getText(resId));
	}

	public void showShort(CharSequence s) {
		mToast.setDuration(Toast.LENGTH_SHORT);
		mToast.setText(s);
		mToast.show();
	}

	public void showLong(int resId) {
		showLong(mContext.getText(resId));
	}

	public void showLong(CharSequence s) {
		mToast.setDuration(Toast.LENGTH_LONG);
		mToast.setText(s);
		mToast.show();
	}

	public void cancel() {
		mToast.cancel();
	}

}
